#
# @lc app=leetcode.cn id=283 lang=python3
#
# [283] 移动零
#
from typing import List
# @lc code=start

class Solution:
    def moveZeroes(self, nums: List[int]) -> None:
        """
        Do not return anything, modify nums in-place instead.
        """
        slow, fast = 0, 0
        n = len(nums)
        while slow < n:
            if fast < n:
                if nums[fast] != 0:
                    nums[slow] = nums[fast]
                    slow += 1
                fast += 1
            else:           
                nums[slow]=0
                slow += 1
        
# @lc code=end

Solution.moveZeroes(Solution,[0,1,0,3,12])